<?php
/**
 * Created by PhpStorm.
 * User: 戎大富
 * Date: 2019/3/29
 * Time: 15:44
 */
namespace app\admin\controller;
use think\Db;
use think\Request;
class Version extends Base {
    public function index(){
        if(Request::instance()->isPost()){
            $about_us = input('about_us');//内容
            $res = Db::table('up_about')->where('id', 4)->setField('content', $about_us);
            if($res){
                return json(['code' => 200, 'msg' => '编辑成功']);
            }else{//测试
                return json(['code' => 100, 'msg' => '编辑失败']);
            }
        }
        $about_us = Db::table('up_about')->where('id', 4)->value('content');
        $this->assign('about_us', $about_us);
        return $this->fetch('version/index');
    }
}